/* 
       This file documents how a waveshape config works and gives some background instructions that apply to all types of "config" files...

       This is a documented WhiteCap 'config' file designed to explain them in the hopes that you can make you own.  If you make your own configs and they turn out well, please send me them--I'll include what you send in a cool configs folder when i release the next version of WhiteCap (my email: aco5@cornell.edu).  Check out other config files to see how the various parameters can be used in different ways.  To make things easier, I put the stuff seen by WhiteCap in boldface type (ie. not the comments like these I'm typing in now--there's two ways to make comments).  
       If you see something is quotes or just a number in bold, it's matched up to the 3 or 4 letter parameter name on its left, separated by "=".   If you see something in quotes, it's called an expression and you can do all the things described below as well as reference various other global values (A, B, C, D vars, dt, st, t, and mag()--all explained later).  When you see a parameter not in quotes, it means that you can only put an integer value there (ex, 4, -55, 4343--nothing but digits and a leading dash if it's negative).  Also, be sure you don't forget key things like commas and quotes that signify where data stops and starts.    Parameters are assumed to be 0 or "0" (depending on the type) if they are omitted from a config file.  
       Many parameters in a WhiteCap config file ask for 'expressions'.  Expressions are functions--they represent a single value that depends on an algebraic combonation of constants, and variables through operators and functions.  "3*b", "3.141", "sqrt(t+7)", and "(s+t+2.7)^dt" are all examples of expressions.  In WhiteCap expressions, all letters are case insensitive, and there are the following functions: sin(), cos(), tan(), atan(), sqrt(), sqr(), log(), exp(), tan(), abs(), and...
pos(x) == x when x >= 0 and 0 when x < 0.  
sgn(x) == 1 when x >= 0 and -1 when x < 0
clip(x) == 0 when x < 0, 1 when x > 1, and x when  0 < x < 1
trnc(x) == [x] (ie, the decimal portion is stripped)
wrap(x) == x - floor(x)  (ex, wrap( 4.124 ) = .124, wrap( - 2.7 ) = .3 )
rnd(x) returns a random (float) value from 0 to x (inclusive)
seed(x) seeds the random number generator to x, returns x
sqwv(x) == 1 if |x| <= 1.0 and 0 otherwise.
trwv(x) == |x| if |x| < 1 and trwv( |x| - 2 ) otherwise.
       Operators are used to combine two values in expressions, and the operators available in WhiteCap are: +,-,*,/,%,^  (% is the mod operator and the a^b is a raised to the b power). Traditional order of operations apply and you may freely use parentheses.  */


/* Coordinate Aspect: 
 1 forces the x:y scale to 1:1,
 0 warps the scale so that (-1,-1) is the bottom-left of the window and (1,1) is the top-right of the window.  In G-Force, the center of the screen/window is (0,0), the top-right corner is (1,1), the bottom-right corner is (1,-1), and so on.  When Aspc is set to 1, the x to y ratio is forced to 1:1 (making either the x or the y greater than 1 at the corners. */
Aspc=1,

/*  The "A" variables are evaluated only when a config is loaded/executed.  They're useful for setting random variables that will used for the duration of the waveshape (and will remain constant while the config is in use).  Here, we randomly calculate the rotational speed of our "corridor".  
Variables avalable: t (the system time index in seconds), A[].  */
A0="0.1 + rnd( 0.2 )",

/* The "B" expressions are evaluated at the start of a new frame.  They're useful for computing cpu-intensive values that the whole frame's waves(s) may have in common.  Here, we calculate some values that don't depend on what part of the wavesshape we're drawing.  We then use the "B vars" in expressions later on.  Note that the current sound sample is accessed using the mag() function, and its domain of is from 0 to 1.  
Variables avalable: mag(), t, A[], B[]. */
B0="cos( t * 0.2 )",
B1="sin( t * 0.2 )",

/* The "C" expressions are evaluated for each change in s (ie, as the waveshape is drawn). s varies from 0 to 1 and is the parameter one uses to draw a path.  C expressions are useful for computing values that are intensive to compute and used multiple times in the x and y expressions (and would be redundantly computed if put in the x and y expressions).  
Variables avalable: s, mag(), t, A[], B[], and C[]. */
C0="mag( s ) * 0.25 + .2",
C1="2.1 * ( s - .5 )",


/* The X and Y expressions define what's to be drawn.  For example, X="s+5*t" and Y="3*s" froms a straight path with a slope of 3 and travels rightward at 5 units per second.  G-Force lets you have more than one path and you separate them by the indexing each X and Y (ex, x1, y1, x2, y2, ..., x5, x6).   v1.0 allows up to X14 and Y14, 
Variables avalable: s, mag(), t, A[], B[], and C[].  */

X0="  b0 * c1 + b1 * c0",
Y0="- b0 * c0 + b1 * c1",

X1="  b0 * c1 - b1 * c0",
Y1="  b0 * c0 + b1 * c1",

/* When G-Force draws a waveshape, it draws in a certain color.  You specify this color here, by saying what value/intensity the pen will draw in, from 0 to 1 (the color your see will depend on whatever colormap is loaded).  If you omit this parameter, it's assumed to be 1.  */
Pen="1",


/*  This is how many steps G-Force will chop the interval [0,1] into when it steps 's' from 0 to 1.  When Stps is either 0 or left out from a waveshape file, G-Force will step s the default number of steps from 0 to 1 (defined by the 'Stps' field in the preferences file).  99% of the time, you'll want to let G-Force use the default number of steps. */
Stps=0,

// Set ConB to 0 if you want just dots  (ConB comes from connect bins)
ConB=1,

// This should always equal the version of G-Force they're written for (times one hundred)
Vers=100